import { createBrowserRouter,Navigate } from "react-router-dom";
import Main from "../pages/main";
import Home from "../pages/home";
import User from "../pages/user";
import Mall from "../pages/mall";
import PageOne from "../pages/other/pagesOne";
import PageTwo from "../pages/other/pagesTwo";


const router = createBrowserRouter([
    {
        path: "/",
        Component: Main,
        children: [
            {
                path: "/",
                element: <Navigate to="/home" replace/>
            },
            {
                path: "home",
                Component: Home,
            },
            {
                path: "user",
                Component: User,
            },
            {
                path: "mall",
                Component: Mall,
            },
            {
                path: "other",
                children: [
                    {
                        path: "pageOne",
                        Component: PageOne
                    },
                    {
                        path: "pageTwo",
                        Component: PageTwo
                    }
                ]

            }

        ]
    }
]);

export default router;